<template>
  <div id="app">
    <label for="username">用户名</label>
    <input type="text" id="username" v-model="form.username">
    <br>
    <label for="password">密码</label>
    <input type="password" id="password" v-model="form.password">
    <br>
    <button @click="submit">确认</button>
  </div>
</template>

<script>
  import {
    insertUser1
  } from "./api/user";

  export default {
    name: 'App',
    data() {
      return {
        form: {
          username: undefined,
          password: undefined
        }
      }
    },
    methods: {
      submit() {
        insertUser(this.form).then(res=>{
          console.log(res)
        }).catch(error=>{console.log(error)})
      }
    },
  }
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
